\(\int \frac {\sin (c+d x)}{(a+b \sin ^2(c+d x))^2} \, dx\) [97]

   Optimal result
   Rubi [A] (verified)
   Mathematica [C] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F(-1)]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 74 \[ \int \frac {\sin (c+d x)}{\left (a+b \sin ^2(c+d x)\right )^2} \, dx=-\frac {\text {arctanh}\left (\frac {\sqrt {b} \cos (c+d x)}{\sqrt {a+b}}\right )}{2 \sqrt {b} (a+b)^{3/2} d}-\frac {\cos (c+d x)}{2 (a+b) d \left (a+b-b \cos ^2(c+d x)\right )} \]

[Out]

-1/2*cos(d*x+c)/(a+b)/d/(a+b-b*cos(d*x+c)^2)-1/2*arctanh(cos(d*x+c)*b^(1/2)/(a+b)^(1/2))/(a+b)^(3/2)/d/b^(1/2)

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 74, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3265, 205, 214} \[ \int \frac {\sin (c+d x)}{\left (a+b \sin ^2(c+d x)\right )^2} \, dx=-\frac {\text {arctanh}\left (\frac {\sqrt {b} \cos (c+d x)}{\sqrt {a+b}}\right )}{2 \sqrt {b} d (a+b)^{3/2}}-\frac {\cos (c+d x)}{2 d (a+b) \left (a-b \cos ^2(c+d x)+b\right )} \]

[In]

Int[Sin[c + d*x]/(a + b*Sin[c + d*x]^2)^2,x]

[Out]

-1/2*ArcTanh[(Sqrt[b]*Cos[c + d*x])/Sqrt[a + b]]/(Sqrt[b]*(a + b)^(3/2)*d) - Cos[c + d*x]/(2*(a + b)*d*(a + b
- b*Cos[c + d*x]^2))

Rule 205

Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(-x)*((a + b*x^n)^(p + 1)/(a*n*(p + 1))), x] + Dist[(n*(p
 + 1) + 1)/(a*n*(p + 1)), Int[(a + b*x^n)^(p + 1), x], x] /; FreeQ[{a, b}, x] && IGtQ[n, 0] && LtQ[p, -1] && (
IntegerQ[2*p] || (n == 2 && IntegerQ[4*p]) || (n == 2 && IntegerQ[3*p]) || Denominator[p + 1/n] < Denominator[
p])

Rule 214

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x/Rt[-a/b, 2]], x] /; FreeQ[{a, b},
x] && NegQ[a/b]

Rule 3265

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = Free
Factors[Cos[e + f*x], x]}, Dist[-ff/f, Subst[Int[(1 - ff^2*x^2)^((m - 1)/2)*(a + b - b*ff^2*x^2)^p, x], x, Cos
[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2]

Rubi steps \begin{align*} \text {integral}& = -\frac {\text {Subst}\left (\int \frac {1}{\left (a+b-b x^2\right )^2} \, dx,x,\cos (c+d x)\right )}{d} \\ & = -\frac {\cos (c+d x)}{2 (a+b) d \left (a+b-b \cos ^2(c+d x)\right )}-\frac {\text {Subst}\left (\int \frac {1}{a+b-b x^2} \, dx,x,\cos (c+d x)\right )}{2 (a+b) d} \\ & = -\frac {\text {arctanh}\left (\frac {\sqrt {b} \cos (c+d x)}{\sqrt {a+b}}\right )}{2 \sqrt {b} (a+b)^{3/2} d}-\frac {\cos (c+d x)}{2 (a+b) d \left (a+b-b \cos ^2(c+d x)\right )} \\ \end{align*}

Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 0.26 (sec) , antiderivative size = 149, normalized size of antiderivative = 2.01 \[ \int \frac {\sin (c+d x)}{\left (a+b \sin ^2(c+d x)\right )^2} \, dx=\frac {\frac {\arctan \left (\frac {\sqrt {b}-i \sqrt {a} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {-a-b}}\right )}{\sqrt {-a-b} \sqrt {b}}+\frac {\arctan \left (\frac {\sqrt {b}+i \sqrt {a} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {-a-b}}\right )}{\sqrt {-a-b} \sqrt {b}}-\frac {2 \cos (c+d x)}{2 a+b-b \cos (2 (c+d x))}}{2 (a+b) d} \]

[In]

Integrate[Sin[c + d*x]/(a + b*Sin[c + d*x]^2)^2,x]

[Out]

(ArcTan[(Sqrt[b] - I*Sqrt[a]*Tan[(c + d*x)/2])/Sqrt[-a - b]]/(Sqrt[-a - b]*Sqrt[b]) + ArcTan[(Sqrt[b] + I*Sqrt
[a]*Tan[(c + d*x)/2])/Sqrt[-a - b]]/(Sqrt[-a - b]*Sqrt[b]) - (2*Cos[c + d*x])/(2*a + b - b*Cos[2*(c + d*x)]))/
(2*(a + b)*d)

Maple [A] (verified)

Time = 0.58 (sec) , antiderivative size = 65, normalized size of antiderivative = 0.88

method result size
derivativedivides \(\frac {-\frac {\cos \left (d x +c \right )}{2 \left (a +b \right ) \left (a +b -b \left (\cos ^{2}\left (d x +c \right )\right )\right )}-\frac {\operatorname {arctanh}\left (\frac {b \cos \left (d x +c \right )}{\sqrt {\left (a +b \right ) b}}\right )}{2 \left (a +b \right ) \sqrt {\left (a +b \right ) b}}}{d}\) \(65\)
default \(\frac {-\frac {\cos \left (d x +c \right )}{2 \left (a +b \right ) \left (a +b -b \left (\cos ^{2}\left (d x +c \right )\right )\right )}-\frac {\operatorname {arctanh}\left (\frac {b \cos \left (d x +c \right )}{\sqrt {\left (a +b \right ) b}}\right )}{2 \left (a +b \right ) \sqrt {\left (a +b \right ) b}}}{d}\) \(65\)
risch \(\frac {{\mathrm e}^{3 i \left (d x +c \right )}+{\mathrm e}^{i \left (d x +c \right )}}{\left (a +b \right ) d \left (b \,{\mathrm e}^{4 i \left (d x +c \right )}-4 a \,{\mathrm e}^{2 i \left (d x +c \right )}-2 b \,{\mathrm e}^{2 i \left (d x +c \right )}+b \right )}+\frac {i \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {2 i \left (a +b \right ) {\mathrm e}^{i \left (d x +c \right )}}{\sqrt {-a b -b^{2}}}+1\right )}{4 \sqrt {-a b -b^{2}}\, \left (a +b \right ) d}-\frac {i \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 i \left (a +b \right ) {\mathrm e}^{i \left (d x +c \right )}}{\sqrt {-a b -b^{2}}}+1\right )}{4 \sqrt {-a b -b^{2}}\, \left (a +b \right ) d}\) \(193\)

[In]

int(sin(d*x+c)/(a+b*sin(d*x+c)^2)^2,x,method=_RETURNVERBOSE)

[Out]

1/d*(-1/2*cos(d*x+c)/(a+b)/(a+b-b*cos(d*x+c)^2)-1/2/(a+b)/((a+b)*b)^(1/2)*arctanh(b*cos(d*x+c)/((a+b)*b)^(1/2)
))

Fricas [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 282, normalized size of antiderivative = 3.81 \[ \int \frac {\sin (c+d x)}{\left (a+b \sin ^2(c+d x)\right )^2} \, dx=\left [\frac {{\left (b \cos \left (d x + c\right )^{2} - a - b\right )} \sqrt {a b + b^{2}} \log \left (-\frac {b \cos \left (d x + c\right )^{2} - 2 \, \sqrt {a b + b^{2}} \cos \left (d x + c\right ) + a + b}{b \cos \left (d x + c\right )^{2} - a - b}\right ) + 2 \, {\left (a b + b^{2}\right )} \cos \left (d x + c\right )}{4 \, {\left ({\left (a^{2} b^{2} + 2 \, a b^{3} + b^{4}\right )} d \cos \left (d x + c\right )^{2} - {\left (a^{3} b + 3 \, a^{2} b^{2} + 3 \, a b^{3} + b^{4}\right )} d\right )}}, \frac {{\left (b \cos \left (d x + c\right )^{2} - a - b\right )} \sqrt {-a b - b^{2}} \arctan \left (\frac {\sqrt {-a b - b^{2}} \cos \left (d x + c\right )}{a + b}\right ) + {\left (a b + b^{2}\right )} \cos \left (d x + c\right )}{2 \, {\left ({\left (a^{2} b^{2} + 2 \, a b^{3} + b^{4}\right )} d \cos \left (d x + c\right )^{2} - {\left (a^{3} b + 3 \, a^{2} b^{2} + 3 \, a b^{3} + b^{4}\right )} d\right )}}\right ] \]

[In]

integrate(sin(d*x+c)/(a+b*sin(d*x+c)^2)^2,x, algorithm="fricas")

[Out]

[1/4*((b*cos(d*x + c)^2 - a - b)*sqrt(a*b + b^2)*log(-(b*cos(d*x + c)^2 - 2*sqrt(a*b + b^2)*cos(d*x + c) + a +
 b)/(b*cos(d*x + c)^2 - a - b)) + 2*(a*b + b^2)*cos(d*x + c))/((a^2*b^2 + 2*a*b^3 + b^4)*d*cos(d*x + c)^2 - (a
^3*b + 3*a^2*b^2 + 3*a*b^3 + b^4)*d), 1/2*((b*cos(d*x + c)^2 - a - b)*sqrt(-a*b - b^2)*arctan(sqrt(-a*b - b^2)
*cos(d*x + c)/(a + b)) + (a*b + b^2)*cos(d*x + c))/((a^2*b^2 + 2*a*b^3 + b^4)*d*cos(d*x + c)^2 - (a^3*b + 3*a^
2*b^2 + 3*a*b^3 + b^4)*d)]

Sympy [F(-1)]

Timed out. \[ \int \frac {\sin (c+d x)}{\left (a+b \sin ^2(c+d x)\right )^2} \, dx=\text {Timed out} \]

[In]

integrate(sin(d*x+c)/(a+b*sin(d*x+c)**2)**2,x)

[Out]

Timed out

Maxima [A] (verification not implemented)

none

Time = 0.39 (sec) , antiderivative size = 98, normalized size of antiderivative = 1.32 \[ \int \frac {\sin (c+d x)}{\left (a+b \sin ^2(c+d x)\right )^2} \, dx=\frac {\frac {2 \, \cos \left (d x + c\right )}{{\left (a b + b^{2}\right )} \cos \left (d x + c\right )^{2} - a^{2} - 2 \, a b - b^{2}} + \frac {\log \left (\frac {b \cos \left (d x + c\right ) - \sqrt {{\left (a + b\right )} b}}{b \cos \left (d x + c\right ) + \sqrt {{\left (a + b\right )} b}}\right )}{\sqrt {{\left (a + b\right )} b} {\left (a + b\right )}}}{4 \, d} \]

[In]

integrate(sin(d*x+c)/(a+b*sin(d*x+c)^2)^2,x, algorithm="maxima")

[Out]

1/4*(2*cos(d*x + c)/((a*b + b^2)*cos(d*x + c)^2 - a^2 - 2*a*b - b^2) + log((b*cos(d*x + c) - sqrt((a + b)*b))/
(b*cos(d*x + c) + sqrt((a + b)*b)))/(sqrt((a + b)*b)*(a + b)))/d

Giac [A] (verification not implemented)

none

Time = 0.47 (sec) , antiderivative size = 79, normalized size of antiderivative = 1.07 \[ \int \frac {\sin (c+d x)}{\left (a+b \sin ^2(c+d x)\right )^2} \, dx=\frac {\arctan \left (\frac {b \cos \left (d x + c\right )}{\sqrt {-a b - b^{2}}}\right )}{2 \, \sqrt {-a b - b^{2}} {\left (a + b\right )} d} + \frac {\cos \left (d x + c\right )}{2 \, {\left (b \cos \left (d x + c\right )^{2} - a - b\right )} {\left (a + b\right )} d} \]

[In]

integrate(sin(d*x+c)/(a+b*sin(d*x+c)^2)^2,x, algorithm="giac")

[Out]

1/2*arctan(b*cos(d*x + c)/sqrt(-a*b - b^2))/(sqrt(-a*b - b^2)*(a + b)*d) + 1/2*cos(d*x + c)/((b*cos(d*x + c)^2
 - a - b)*(a + b)*d)

Mupad [B] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 62, normalized size of antiderivative = 0.84 \[ \int \frac {\sin (c+d x)}{\left (a+b \sin ^2(c+d x)\right )^2} \, dx=-\frac {\cos \left (c+d\,x\right )}{2\,d\,\left (a+b\right )\,\left (-b\,{\cos \left (c+d\,x\right )}^2+a+b\right )}-\frac {\mathrm {atanh}\left (\frac {\sqrt {b}\,\cos \left (c+d\,x\right )}{\sqrt {a+b}}\right )}{2\,\sqrt {b}\,d\,{\left (a+b\right )}^{3/2}} \]

[In]

int(sin(c + d*x)/(a + b*sin(c + d*x)^2)^2,x)

[Out]

- cos(c + d*x)/(2*d*(a + b)*(a + b - b*cos(c + d*x)^2)) - atanh((b^(1/2)*cos(c + d*x))/(a + b)^(1/2))/(2*b^(1/
2)*d*(a + b)^(3/2))